package com.maple.exception;

import com.maple.enumeration.ExceptionEnum;
import lombok.Data;

/**
 * 业务异常
 */
@Data
public class BusinessException extends RuntimeException {

    private Integer code;
    private String msg;

    public BusinessException(ExceptionEnum data) {
        super(data.getMsg());
        this.code = data.getCode();
        this.msg = data.getMsg();
    }

    public BusinessException(Integer code, String msg){
        super(msg);
        this.code = code;
        this.msg = msg;
    }

}
